Ai will do value
Definition The ai_will_do value is used as a subobject that determines the likelihood the AI will pick something for the country. it is used as part of defining national focuses and government positions. When the AI needs to pick a focus within its focus tree, it considers all possibilities and then picks a random number between 0 and all factors added together. So if there are only two focuses available, one has a factor of 10 and the other has a factor of 20. Then the AI is twice as likely to pick the focus with the factor of 20. If there are two focuses with a factor of 40 and a focus with a factor of 80, then the AI is 50% likely to pick the focus of factor 80 because 80 is half of the total factor of 160. Format ai_will_do = { factor = 60 modifier = { factor = 0.5 is_in_faction_with = GER } } The way the ai_will_do works is a bit misleading. ai_will_do contains the keyword "factor" which gives the chance the AI will perform this action. The number you set it to, is not a percentage nor a fraction itself: neither 1.0 nor 100 represents a 100% likelihood that the AI will pick it. The modifier keyword and value can be used to denote a conditional multiplier to the base factor. The modifier value consists of a factor of its own and any amount of conditions. If the conditions are met then the factor value is multiplied with the base factor. In the example above the result would be a likelihood of 30 for the AI to still pick that focus. Tips # When not defined, the ai_will_do factor defaults to 1 (unconfirmed). # If you use a factor of 0, then the AI will never pick it, even if it has no other options available. # There seems to be a hidden modifier that already increases the likelihood for the AI to pick focuses deeper down the focus tree. # Not only can you use multiple conditions within a single modifier value, but you can also use multiple modifiers within a single ai_will_do value. If you do, the base factor will be multiplied by all modifier factors where the conditions are met. # It is recommended that when changing a file, you try to stick to similar amounts of factor values as used elsewhere in that file, to avoid erratic AI behavior. # The AI does not seem to recognize the ai_will_do factor of focuses it has not yet unlocked. It will not go through low priority focuses just to end up on a big priority one. The Base 40 system The Base 40 system is a system for ai_will_do, where it assumes the average factor of any choice is 40. Now that you have this baseline in your head, it is much easier to imagine what a factor of 20 or 80 means respectively. The number 40 is picked because it is a nice number to half or double multiple times with modifiers, while being an easy number to work with. You can set up your factors to represent the chances as shown below in the table.